<div id="panel" class="fssmall">
	<div class="wsn">
		<?php
		$user = Model_Reg::get('user');
		if ($user->id > 0):
			echo '<span class="avatar">'.Model_User::html_avatar($user).'</span> ';
			echo '<span class="name">'.Model_User::nickname($user).'</span> ';
			echo '<span class="sep fclight">|</span> ';
			echo (Request::current()->route() == Route::get('frontend_user') AND Request::current()->action() == 'profile')
				? '<span>Личный кабинет</span>'
				: '<a href="'.URL::site(Route::get('frontend_user')->uri(array('action' => 'profile')), TRUE).'">Личный кабинет</a> ';
			echo '<span class="sep fclight">|</span> ';
			echo '<a href="'.URL::site(Route::get('frontend_user')->uri(array('action' => 'logout')), TRUE).'">Выйти</a>';
		else:
			?><span class="avatar"><?php echo Model_User::html_avatar($user); ?></span>
			<a class="dashed" href="https://loginza.ru/api/widget?token_url=<?php echo urlencode('http://'.$_SERVER['SERVER_NAME'].'/'); ?>" class="loginza">Войти через OpenID</a><?php
		endif;
		?>
	</div>
</div>